<template>
    <a :class="{disabled: disabled}" @click="onClick">
        <slot></slot>
    </a>
</template>

<script>
    export default {
        name: "h-link",
        props: {
            disabled: {
                type: Boolean,
                default: false
            }
        },
        methods: {
            onClick() {
                if (!this.disabled) {
                    this.$emit('click')
                }
            }
        }
    }
</script>

<style scoped lang="less">
    a.disabled {
        color: #989898;
        cursor: not-allowed;
    }

</style>